//
//  FeatureCell.m
//  Korea
//
//  Created by 崔剑 on 15/8/31.
//  Copyright (c) 2015年 KoreaGo. All rights reserved.
//

#import "FeatureCell.h"
#import "Header.h"

@implementation FeatureCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        
        self.featureImage = [[UIImageView alloc] init];
        self.featureImage.backgroundColor = [UIColor cyanColor];
        [self.contentView addSubview:self.featureImage];
        
        self.lowerView = [[UIImageView alloc] init];
        [self.lowerView setImage:[UIImage imageNamed:@"lower@3x.png"]];
//        [[self.lowerView layer] setShadowOpacity:0];
        [self.featureImage addSubview:self.lowerView];
        
        self.titleLabel = [[UILabel alloc] init];
        self.titleLabel.textColor = [UIColor whiteColor];
        self.titleLabel.font = [UIFont boldSystemFontOfSize:17];
        [self.lowerView addSubview:self.titleLabel];
    }
    
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    CGFloat width = self.contentView.frame.size.width;
    CGFloat height = self.contentView.frame.size.height - 10;
    
    self.featureImage.frame = CGRectMake(0, 0, width, height);
    self.lowerView.frame = CGRectMake(0, height / 4 * 3, width, height / 4);
    self.titleLabel.frame = CGRectMake(15, 5, width, height / 4 - 10);
    
    
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
